package com.reporting.yb.module.system.dal.mysql.wxusers;

import java.util.*;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.reporting.yb.framework.common.pojo.PageResult;
import com.reporting.yb.framework.mybatis.core.mapper.BaseMapperX;
import com.reporting.yb.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.reporting.yb.module.system.controller.admin.wxusers.vo.WxUsersPageReqVO;
import com.reporting.yb.module.system.dal.dataobject.wxusers.WeChatUserDO;
import com.reporting.yb.module.system.dal.dataobject.wxusers.WxUsersDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 微信登录 用户 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface WxUsersMapper extends BaseMapperX<WxUsersDO> {

     static WeChatUserDO selectByOpenid(String openid) {
        return null;
    }

    default PageResult<WxUsersDO> selectPage(WxUsersPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WxUsersDO>()
                .likeIfPresent(WxUsersDO::getNickName, reqVO.getNickName())
                .eqIfPresent(WxUsersDO::getMobile, reqVO.getMobile())
                .eqIfPresent(WxUsersDO::getAvatarUrl, reqVO.getAvatarUrl())
                .eqIfPresent(WxUsersDO::getOpenId, reqVO.getOpenId())
                .eqIfPresent(WxUsersDO::getSessionKey, reqVO.getSessionKey())
                .eqIfPresent(WxUsersDO::getCity, reqVO.getCity())
                .eqIfPresent(WxUsersDO::getProvince, reqVO.getProvince())
                .eqIfPresent(WxUsersDO::getCountry, reqVO.getCountry())
                .eqIfPresent(WxUsersDO::getLanguage, reqVO.getLanguage())
                .eqIfPresent(WxUsersDO::getGender, reqVO.getGender())
                .eqIfPresent(WxUsersDO::getSpareField1, reqVO.getSpareField1())
                .eqIfPresent(WxUsersDO::getSpareField2, reqVO.getSpareField2())
                .eqIfPresent(WxUsersDO::getSpareField3, reqVO.getSpareField3())
                .eqIfPresent(WxUsersDO::getSpareField4, reqVO.getSpareField4())
                .eqIfPresent(WxUsersDO::getSpareField5, reqVO.getSpareField5())
                .betweenIfPresent(WxUsersDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WxUsersDO::getId));
    }




}